<?include("../../config/config.php");
$DM->loadClass("tracker","site");
// create and instance class
$object_site = new site();
$object_site->id_site = array_key_exists("id_site",$_POST)?$_POST["id_site"]:""; 
$object_site->id_company = array_key_exists("id_company",$_POST)?$_POST["id_company"]:""; 
$object_site->txt_name = array_key_exists("txt_name",$_POST)?$_POST["txt_name"]:""; 
$object_site->txt_url = array_key_exists("txt_url",$_POST)?$_POST["txt_url"]:""; 
$object_site->bol_active = array_key_exists("bol_active",$_POST)?$_POST["bol_active"]:""; 
if ($object_site->save()){
	header("Location: site.list.php?idc=$object_site->id_company");
}else{
	exit("Erro ao salvar site");
}
?>
